
//
//  OrderdatailTableViewCell.m
//  OneCreditTreasure
//
//  Created by iOS Grouper on 16/8/30.
//
//

#import "OrderdatailTableViewCell.h"

@interface OrderdatailTableViewCell ()
@property (nonatomic, strong) UIView *infoView;
@property (nonatomic, strong)UILabel *statL;

@end
@implementation OrderdatailTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self infoView];
        self.contentView.backgroundColor = LV;
    }
    
    return self;
}
- (UIView *)infoView {
    if(_infoView == nil) {
        _infoView = [[UIView alloc] init];
        _infoView.backgroundColor = [UIColor whiteColor];
        [self addSubview:_infoView];
        CGFloat infoViewWidth = kScreenW - 90;
        [_infoView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerX.equalTo(0);
            make.top.equalTo(15);
            make.height.equalTo(70);
            make.width.equalTo(infoViewWidth);
        }];
        _infoView.layer.borderWidth = 1;
        _infoView.layer.borderColor = [[UIColor lightGrayColor] CGColor];
        
        CGFloat LBWidth = infoViewWidth / 3;
        //首付LB
        UILabel *firstPaymentLB = [UILabel new];
        [_infoView addSubview:firstPaymentLB];
        [firstPaymentLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.top.bottom.equalTo(0);
            make.width.equalTo(LBWidth);
        }];
        firstPaymentLB.text = @"首付\n224100元";
        myLBSettings(firstPaymentLB);
        
        //分割线
        UIView *lineView = [UIView new];
        lineView.backgroundColor = [UIColor lightGrayColor];
        [_infoView addSubview:lineView];
        [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.equalTo(0);
            make.left.equalTo(firstPaymentLB.mas_right).equalTo(0);
            make.width.equalTo(1);
        }];
        
        //期数LB
        UILabel *payNumberLB = [UILabel new];
        [_infoView addSubview:payNumberLB];
        [payNumberLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.bottom.equalTo(0);
            make.left.equalTo(lineView.mas_right).equalTo(0);
            make.width.equalTo(LBWidth);
        }];
        payNumberLB.text = @"期数\n36期";
        myLBSettings(payNumberLB);
        
        //分割线
        UIView *lineView1 = [UIView new];
        lineView1.backgroundColor = [UIColor lightGrayColor];
        [_infoView addSubview:lineView1];
        [lineView1 mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(payNumberLB.mas_right).equalTo(0);
            make.top.bottom.equalTo(0);
            make.width.equalTo(1);
        }];
        
        //月供LB
        UILabel *paymentLB = [UILabel new];
        [_infoView addSubview:paymentLB];
        [paymentLB mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.equalTo(lineView1.mas_right).equalTo(0);
            make.top.bottom.equalTo(0);
            make.right.equalTo(0);
        }];
        paymentLB.text = @"月供\n18080元起";
        myLBSettings(paymentLB);
       
        
        
        
        _statL = [UILabel new];
        [self.contentView addSubview:_statL];
        [_statL mas_makeConstraints:^(MASConstraintMaker *make) {
            make.top.mas_equalTo(_infoView.mas_bottom).offset(5 * AUTO_HEIGHT);
            make.right.mas_equalTo(self.contentView.mas_right).offset(-10 * AUTO_WIDTH);
            make.height.mas_equalTo(15 * AUTO_HEIGHT);
            
        }];
        _statL.text = @"已放款";
        _statL.textColor = HS;
        _statL.font = [UIFont fontWithName:ZIXING size:12 * AUTO_HEIGHT];
    }
    return _infoView;
}

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
